package logger

import (
	"sync"
)

var (
	initialized bool
	initOnce    sync.Once
)

func Init(cfg *LogConfig) {
	initOnce.Do(func() {
		// Initialize default logger
		initDefaultLogger(cfg.Default)

		// Initialize module loggers
		for moduleName, moduleCfg := range cfg.Modules {
			initModuleLogger(moduleName, moduleCfg)
		}

		initialized = true
	})
}

// IsInitialized checks if the logging system is initialized
func IsInitialized() bool {
	return initialized
}
